GodTier.Views['homeButton'] = Backbone.View.extend( {

    tagName: 'div',

    className: '',

    events: { },

    initialize: function() {

        this.render();

        return this;
    },

    render: function() {

        if( this.options.backgroundImage ) {
            
            this.button = GodTier.CommonLib.makeEl('div')
                .attr( { 'class': 'cursorHand' } )
                .width( this.options.backgroundImage.width )
                .height( this.options.backgroundImage.height )
                .css( { 'background-image':
                        [ 'url(', GodTier.CommonLib.makeUrl( { controller: 'static', argList: [ 'images', this.options.backgroundImage.filename ] } ), ')' ].join(''),
                        'position': 'absolute',
                        'font-size': '1.5em' } );
        } else {

            this.button = GodTier.CommonLib.makeEl('div')
                .attr( { 'class': 'cursorHand' } )
                .width( $( window ).width() / 3 )
                .css( { 'text-align': 'center',
                        'position': 'absolute',
                        'padding': '1em 1em',
                        'border': '1px solid black',
                        'font-size': '1.5em',
                        'color': 'white',
                        'background-color': this.options.color.light,
                        'background': [ '-webkit-gradient(linear, left top, left bottom, from(',
                                        this.options.color.light,
                                        '), to(',
                                        this.options.color.dark, '))' ].join(''),
                        'box-shadow': '0px 0px 2px #bababa, inset 0px 0px 1px #ffffff' } );
        }

        this.$el.height( this.options.height )
                .css( { 'position': 'relative' } )
                .append( this.button );
        
        GodTier.CommonLib.centerEl( { el: this.button, parentEl: this.$el } );

        return this;
    },

    redirect: function() { window.location = GodTier.CommonLib.makeUrl( { controller: this.options.redirectLocation, argList: [ 'index' ] } ); }

} );
